<html>
<head>
<title>300px Body</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #000000}
-->
.error_strings{ font-family:Verdana; font-size:10px; color:#660000;}
</Style>
<script type="text/javascript" language="javascript">

</script>

<script language="javaScript" type="text/javascript" src="../calander/calendar.js"></script>
<link href="../calander/calendar.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../logic/validation/validation.js" type="text/javascript"></script>
<script language="JavaScript" src="../logic/validation/student_update.js" type="text/javascript"></script>


</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (300px Body.jpg) -->


<table width="800" height="481" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
	<tr>
		<td><img src="../images/st_update.gif" width="800" height="69"></td>
	</tr>
	<tr >
	<td height="372" background="../images/2.gif" style="background-repeat:repeat-y">
	
	<table width="749" border="0" align="center" cellpadding="0" cellspacing="0">
	
	<?php 
	$id=$_GET['edit'];
	$startrow=$_GET['startrow'];
	$tag=$_GET['tag'];
	include'../logic/Classes/db.php';
	
	$x=new Dbconnect();
	
	$con=$x->getConnection();
	
	$result=mysql_query("select reg_no,initials,f_name,l_name,gender,b_date,nic,address,tel_no,email,j_date from student where reg_no='$id'",$con) or die(mysql_error()); 
	
	  $time_now=mktime(date('H')+5,date('i')+30,date('s'),date('m'),date('d'),date('Y'));
	  $year=date('Y',$time_now);
	  
	  $initial=($year-10);
	  $x=($year-22);
	  ?>
	
	 <?php
	  while($row=mysql_fetch_array($result))
	  {  
           ?>
	
	<form id="myForm">
     
      <tr>
        <td width="118" height="22">&nbsp;</td>
        <td width="132"><div align="right"><strong>Initials&nbsp;&nbsp;&nbsp; </strong></div></td>
        <td colspan="6"><input name="txtIni" type="text" id="txtIni" value="<?php echo $row['initials']; ?>">
          <input type="hidden" name="txtRegno" id="txtRegno" value="<?php echo $row['reg_no']; ?>"></td>
        <td width="171">Required<span class="style1"> <span class="style2">Field </span>* </span></td>
        <td width="28">&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>First Name <span class="style1">*</span> </strong> </div></td>
        <td colspan="6"><input name="txtFn" type="text" id="txtFn" value="<?php echo $row['f_name']; ?>">
          <input type="hidden" id="startrow" name="hiddenField" value="<?php echo $startrow; ?>"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td> 
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td> 
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>Last Name</strong> <span class="style1">*</span> </div></td>
        <td colspan="6"><input name="txtLn" type="text" id="txtLn" value="<?php echo $row['l_name']; ?>">
          <input type="hidden" id="tag" name="hiddenField2" value="<?php echo $tag; ?>"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="25">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>Gender <span class="style1">*</span> </strong></div></td>
        <td colspan="6">
		            <input name="sltGen" type="radio" id="sltGen1" value="Male" <?php if ($row['gender']=="Male") { ?> checked <?php } ?> >Male 
        			<input name="sltGen" type="radio" id="sltGen2" value="Female" <?php if ($row['gender']=="Female") { ?> checked <?php } ?> >Female
					 
									 
          <input type="hidden" name="hiddenField3" id="jdt""hiddenField" value="<?php echo $row['j_date']; ?>"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
 <?php $bdt1=$row['b_date'];
$month=substr($bdt1,5,2);
$year=substr($bdt1,0,4);
$day=substr($bdt1,8,2);
$b_dt=$day."-".$month."-".$year;
//$b_dt;
?>

      
      
      
      
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>BirthDay</strong> <span class="style1">*</span> </div></td>
        <td width="4">&nbsp;</td>
        <td colspan="5"><input type="text" name="txtBd" id="txtBd" value="<?php echo "$b_dt" ; ?>">
        <a href="#" onClick="setYears(1990, 2007);
       showCalender(this, 'txtBd');">
      <img src="../calander/calender.png" width="24" height="20"></a>

    <!-- Calender Script  --> 

    <table id="calenderTable">
        <tbody id="calenderTableHead">
          <tr>
            <td colspan="4" align="center">
	          <select onChange="showCalenderBody(createCalender(document.getElementById('selectYear').value,
	           this.selectedIndex, false));" id="selectMonth">
	              <option value="0">Jan</option>
	              <option value="1">Feb</option>
	              <option value="2">Mar</option>
	              <option value="3">Apr</option>
	              <option value="4">May</option>
	              <option value="5">Jun</option>
	              <option value="6">Jul</option>
	              <option value="7">Aug</option>
	              <option value="8">Sep</option>
	              <option value="9">Oct</option>
	              <option value="10">Nov</option>
	              <option value="11">Dec</option>
	          </select>
            </td>
            <td colspan="2" align="center">
			    <select onChange="showCalenderBody(createCalender(this.value,document.getElementById('selectMonth').selectedIndex, false));" id="selectYear">
				</select>
			</td>
            <td align="center">
			    <a href="#" onClick="closeCalender();"><font color="#003333" size="+1">X</font></a>
			</td>
		  </tr>
       </tbody>
       <tbody id="calenderTableDays">
         <tr style="">
           <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
         </tr>
       </tbody>
       <tbody id="calender"></tbody>
    </table>

<!-- End Calender Script  --> </td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>NIC&nbsp;&nbsp;&nbsp;</strong></div></td>
        <td colspan="6"><input name="txtNic" type="text" id="txtNic" onBlur="nicload()" value="<?php echo $row['nic']; ?>"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr> 
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6"><div id='ajaxDiv2' class="error_strings" >&nbsp;</div></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="25">&nbsp;</td>
        <td><div align="right"><strong>Address <span class="style1">*</span> </strong></div></td>
        <td colspan="6"><textarea name="txtAdd" rows="3" id="txtAdd"><?php echo $row['address']; ?></textarea></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>Contact No&nbsp;&nbsp;&nbsp;</strong> </div></td>
        <td colspan="6"><input name="txtCn" type="text" id="txtCn" value="<?php echo $row['tel_no']; ?>"></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="22">&nbsp;</td>
        <td><div align="right"><strong>Email&nbsp;&nbsp;&nbsp;</strong></div></td>
        <td colspan="6"><input name="txtEmail" type="text" id="txtEmail" onBlur="mailload()" value="<?php echo $row['email']; ?>" ></td>
        <td><div id="em" align="left">&nbsp;</div></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6"><div id='ajaxDiv1' class="error_strings" >&nbsp;</div></td>
        <td></td>
        <td>&nbsp;</td>
      </tr>
	
      <tr>
        <td height="19">&nbsp;</td>
        <td height="19">&nbsp;</td>
        <td height="19" colspan="6"><div id='ajaxDiv' class="error_strings" ></div></td>
        <td height="19">&nbsp;</td>
        <td height="19">&nbsp;</td>
      </tr>
	  </form>
	  <?php } ?>
      <tr>
        <td height="25">&nbsp;</td>
        <td height="25">&nbsp;</td>
        <td>&nbsp;</td>
        <td width="66" height="25"><input name="submit" type="submit" id="submit" onClick="formValidator()" value="Update"></td>
        <td width="31" height="25">&nbsp;</td>
        <td width="70"><input type="reset" name="Submit2" value="Back" onClick="backx()"></td>
        <td width="6" height="25">&nbsp;</td>
        <td width="123" height="25">&nbsp;</td>
        <td height="25">&nbsp;</td>
        <td height="25">&nbsp;</td>
      </tr>
    </table>	</td>
	</tr>
	<tr>
		<td>
			<img src="../images/3.gif" width="800" height="40" alt=""></td>
	</tr>
</table>

<!-- End ImageReady Slices -->
</body>
</html>